clear all;
close all;

options = odeset('MaxStep', 1e-2); % 最大步长设为0.01
% x0 = [10; 0; 10; 0; 5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0.72; 0.21; 22; 0.72];
x0 = [10; 0; 10; 0; 5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0];
% [t,x] = ode45('plant',[0 12],x0,options);
[t,x] = ode45('plant',[0 5],x0,options);

phi     = x(:,1);
theta   = x(:,3);
psai    = x(:,5);
z       = x(:,7);
xx      = x(:,9);
y       = x(:,11);
s2      = x(:,13);
ds2     = x(:,14);
s3      = x(:,15);
ds3     = x(:,16);
s4      = x(:,17);
ds4     = x(:,18);
s1      = x(:,19);
ds1     = x(:,20);
gama2_h = x(:,21);
gama3_h = x(:,22);
gama4_h = x(:,23);
gama1_h = x(:,24);

figure(1);
% plot(t,phi,'k',time,phid,'r--');
plot(t,phi,'k');
xlabel('time(s)');ylabel('phi');
legend('φq');
grid on;